/**
 * 功能:TK_PERSONS Service类
 * 开发人员:chengd
 * 创建时间:2012/10/15 21:39:27
 */
package com.towker.frame.service.basicData;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import com.towker.core.db.EntityDao;
import com.towker.core.db.BaseService;
import com.towker.frame.model.basicData.Customs;
import com.towker.frame.model.basicData.Person;
import com.towker.frame.dao.basicData.PersonDao;

@Service
public class PersonService extends BaseService<Person, java.lang.Long>
{
	private PersonDao dao;
	
	public void setPersonDao(PersonDao dao)
	{
		this.dao = dao;
	}

	@SuppressWarnings("unchecked")
	@Override
	protected EntityDao getEntityDao()
	{
		return this.dao;
	}

	public boolean checkExistsCode(String person_code, Integer id) {
		return dao.checkExistsCode(person_code, id);
	}
	
	public List<Person> findByCoCode(String coCode) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("authCoCode", coCode);
		return getList(map);
	}
}